//
//  ComDefinition.h
//  StockSystem
//
//  Created by 小熊 on 2018/6/6.
//  Copyright © 2018年 小熊. All rights reserved.
//

#ifndef ComDefinition_h
#define ComDefinition_h
/**全局域名*/
#define URL_SERVER_HEADER       @"http://apiservice.guinong.com"//正式环境/**
/**屏幕宽度*/
#define DEVICE_WIDTH  [UIScreen mainScreen].bounds.size.width
/**屏幕高度*/
#define DEVICE_HEIGHT [UIScreen mainScreen].bounds.size.height

/**通用单例类*/
#define singleton_implementation(className) \
static className *_instance; \
+ (id)allocWithZone:(NSZone *)zone \
{ \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
_instance = [super allocWithZone:zone]; \
}); \
return _instance; \
} \
+ (className *)shared##className \
{ \
static dispatch_once_t onceToken; \
dispatch_once(&onceToken, ^{ \
_instance = [[self alloc] init]; \
}); \
return _instance; \
}

/**判断ipone的一系列操作*/
#define CYL_DEPRECATED(explain) __attribute__((deprecated(explain)))
#define CYL_IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
#define CYL_IS_IOS_11  ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.f)
#define CYL_IS_IPHONE_X (CYL_IS_IOS_11 && CYL_IS_IPHONE && (MIN([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) == 375 && MAX([UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height) == 812))

#define DefealtImg  [UIImage imageNamed:@"guide_01"]

#endif /* ComDefinition_h */
